﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ClientAppViaWebService.DBAdministration
{
    public partial class RootSchemaTablesAdministrationForm : Form
    {
        private string databaseName;       
        public RootSchemaTablesAdministrationForm(string _databaseName)
        {
            InitializeComponent();
            databaseName = _databaseName;
            foreach (Panel p in this.Controls)
            {
                p.Cursor = Cursors.Hand;
                p.MouseHover += new EventHandler(p_MouseHover);
                p.MouseLeave += new EventHandler(p_MouseLeave);
            }
        }
        void p_MouseLeave(object sender, EventArgs e)
        {
            (sender as Panel).BorderStyle = BorderStyle.None;         
        }

        void p_MouseHover(object sender, EventArgs e)
        {
            (sender as Panel).BorderStyle = BorderStyle.Fixed3D;           
        }      


        private void pnlTobject_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "TObjects");
            f.ShowDialog(this);
        }

        private void pnlDivisions_DoubleClick(object sender, EventArgs e)
        {
            DivisionsAdministrationForm f = new DivisionsAdministrationForm(databaseName);
            f.ShowDialog(this);
        }

        void pnlPerson_DoubleClick(object sender, System.EventArgs e)
        {
            PersonsAdministrationForm f = new PersonsAdministrationForm(databaseName);
            f.ShowDialog(this);
        }

        void pnlProperty_DoubleClick(object sender, System.EventArgs e)
        {
            PropertyAdministrationForm f = new PropertyAdministrationForm(databaseName);
            f.ShowDialog(this);
        }

        void pnlEvents_DoubleClick(object sender, System.EventArgs e)
        {
            EventAdministrationForm f = new EventAdministrationForm(databaseName);
            f.ShowDialog(this);
        }

        void pnlDocumentation_DoubleClick(object sender, System.EventArgs e)
        {
            DocumentationAdministrationForm f = new DocumentationAdministrationForm(databaseName);
            f.ShowDialog(this);
        }
    }
}
